package com.zking.ssm.mapper;

import com.zking.ssm.model.News;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface NewsMapper {
    /**
     * 新闻删除
     * @param newsId
     * @return
     */
    int deleteByPrimaryKey(Integer newsId);

    int deleteByNewsId(Integer newsId);

    int insert(News record);

    int insertSelective(News record);

    News selectByPrimaryKey(Integer newsId);

    int updateByPrimaryKeySelective(News record);

    int updateByPrimaryKey(News record);

    /**
     * 新闻添加
     * @param news
     * @return
     */
    int grantCategory(News news);

    /**
     * 类别删除
     * @param news
     * @return
     */
    int revokeCategory(News news);

    List<News> listNews(News news);
}